using System.Windows.Forms;
using RegExEditor.Properties;

namespace RegExEditor
{
    /// <summary>
    /// Form showing about, licence and copyright information
    /// </summary>
    public class frmAbout : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label lblVersion;
        private System.Windows.Forms.Button btnOK;
        private System.Windows.Forms.LinkLabel llblLink;
        private RichTextBox licenceRichTextBox;
        
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        /// <summary>
        /// Initializes a new instance of the frmAbout class.
        /// </summary>
        public frmAbout()
        {
            // Required for Windows Form Designer support
            InitializeComponent();
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">
        /// true if the object is being disposed; otherwise false.
        /// </param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.llblLink = new System.Windows.Forms.LinkLabel();
            this.lblVersion = new System.Windows.Forms.Label();
            this.btnOK = new System.Windows.Forms.Button();
            this.licenceRichTextBox = new System.Windows.Forms.RichTextBox();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(32, 24);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(456, 20);
            this.label1.TabIndex = 0;
            this.label1.Text = "RegEx Editor";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // llblLink
            // 
            this.llblLink.LinkArea = new System.Windows.Forms.LinkArea(0, 24);
            this.llblLink.Location = new System.Drawing.Point(32, 55);
            this.llblLink.Name = "llblLink";
            this.llblLink.Size = new System.Drawing.Size(456, 13);
            this.llblLink.TabIndex = 2;
            this.llblLink.TabStop = true;
            this.llblLink.Text = "regexeditor.codeplex.com";
            this.llblLink.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.llblLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llblLink_LinkClicked);
            // 
            // lblVersion
            // 
            this.lblVersion.Location = new System.Drawing.Point(32, 79);
            this.lblVersion.Name = "lblVersion";
            this.lblVersion.Size = new System.Drawing.Size(456, 13);
            this.lblVersion.TabIndex = 3;
            this.lblVersion.Text = "Version: 1.02.30202";
            this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // btnOK
            // 
            this.btnOK.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(187)))), ((int)(((byte)(91)))));
            this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
            this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnOK.Location = new System.Drawing.Point(416, 386);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new System.Drawing.Size(72, 24);
            this.btnOK.TabIndex = 4;
            this.btnOK.Text = "OK";
            this.btnOK.UseVisualStyleBackColor = false;
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            // 
            // licenceRichTextBox
            // 
            this.licenceRichTextBox.BackColor = System.Drawing.SystemColors.Window;
            this.licenceRichTextBox.DetectUrls = false;
            this.licenceRichTextBox.Location = new System.Drawing.Point(32, 109);
            this.licenceRichTextBox.Name = "licenceRichTextBox";
            this.licenceRichTextBox.ReadOnly = true;
            this.licenceRichTextBox.Size = new System.Drawing.Size(456, 259);
            this.licenceRichTextBox.TabIndex = 5;
            this.licenceRichTextBox.Text = string.Empty;
            // 
            // frmAbout
            // 
            this.AcceptButton = this.btnOK;
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(238)))), ((int)(((byte)(214)))));
            this.CancelButton = this.btnOK;
            this.ClientSize = new System.Drawing.Size(521, 422);
            this.Controls.Add(this.licenceRichTextBox);
            this.Controls.Add(this.btnOK);
            this.Controls.Add(this.lblVersion);
            this.Controls.Add(this.llblLink);
            this.Controls.Add(this.label1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "frmAbout";
            this.ShowInTaskbar = false;
            this.Text = "About RegEx Editor";
            this.Load += new System.EventHandler(this.About_Load);
            this.ResumeLayout(false);

        }
        #endregion

        private void About_Load(object sender, System.EventArgs e)
        {
            lblVersion.Text = "Version: " + System.Windows.Forms.Application.ProductVersion;

            licenceRichTextBox.Rtf = Resources.License;
        }

        private void btnOK_Click(object sender, System.EventArgs e)
        {
            this.Close();
        }

        private void llblLink_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start("http://regexeditor.codeplex.com");
        }
    }
}
